package com.shopping_back.util;

import java.security.SecureRandom;

public class InviteCodeUtil {
    private static final String CODE_POOL = "ABCDEFGHJKMNPQRSTUVWXYZ23456789";
    private static final SecureRandom RANDOM = new SecureRandom();

    public static String generate(int len) {
        StringBuilder sb = new StringBuilder(len);
        for (int i = 0; i < len; i++) {
            sb.append(CODE_POOL.charAt(RANDOM.nextInt(CODE_POOL.length())));
        }
        return sb.toString();
    }
}

